import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:get/get.dart';
import 'package:FiduMart/app_routes.dart';
import 'package:FiduMart/constants/color_constant.dart';


class BindGameDialog extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Dialog(
      shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
      child: Container(
        decoration: BoxDecoration(
          image: DecorationImage(
              image: AssetImage(
                  "assets/images/modifyHeaderImageAndNameBackImg.png"),
              fit: BoxFit.cover),
          borderRadius: BorderRadius.all(Radius.circular(10)),),
        padding: EdgeInsets.all(10),
        child: Column(
          mainAxisSize: MainAxisSize.min, // 使内容尽量紧凑
          children: <Widget>[
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                SizedBox(
                  width: 50,
                ),
                Text("warm_tips".tr,
                    textAlign: TextAlign.center,
                    style: TextStyle(fontSize: 18,color: Colors.black,fontWeight: FontWeight.bold)),
                IconButton(
                  icon: Icon(Icons.close,color: Colors.white,),
                  onPressed: () {
                    Get.back(); // 使用Get来关闭弹窗
                  },
                ),
              ],
            ),
            Container(
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(16),
              ),
              padding: EdgeInsets.all(20),
              child: Column(
                children: [
                  Image.asset("assets/images/icon_game_bind.png",width: 60,),
                  SizedBox(height: 15,),
                  Text("您还未绑定游戏的账号，请先绑定后，再申请加入"),
                ],
              ),
            ),

            SizedBox(height: 30,),
            Center(
              child: GestureDetector(
                  onTap: (){
                    Get.back();
                    // Get.toNamed(AppRoutes.bindGame, arguments: null);
                  },
                  child: Container(
                    width: 200,
                    height: 40,
                    decoration: BoxDecoration(
                      gradient: LinearGradient(
                        colors: [ColorConstant.colorFFD405EF,
                          ColorConstant.colorFF052BFD],
                        begin: FractionalOffset.centerLeft,
                        end: FractionalOffset.centerRight,
                      ),
                      borderRadius: BorderRadius.circular(2),
                    ),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        Text("去綁定",style: TextStyle(fontSize: 15,color: Colors.white)),
                      ],
                    ),
                  ),
                ),
            ),
          ],
        ),
      ),
    );
  }
}
